class Animal():
    def __init__(self,name):
        self.name = name
    def greet(self):
        print("hello,I am an "+ self.name+".")

# class Dog():
#     def __init__(self, name):
#         self.name =name
#     def greet(self):
#         print('hello,我是'+self.name+".")

class Dog(Animal):
    def greet(self):
        print('旺旺旺！我是'+self.name+"!!")

class Cat(Animal):
    def greet(self):
        print(f'MiaoMiao..,I am {self.name}')

def hello(wawa):
    wawa.greet()


#
# animal = Animal('animal')
# animal.greet()
# dog = Dog('大黄狗')
# dog.greet()

dog = Dog('dog')
hello(dog)